package main

import "fmt"

func intSum2(x ...int) int {
	fmt.Println(x) // x 是一个切片
	sum := 0
	for _, v := range x {
		sum = sum + v
	}
	return sum
}
func main() {
	ret := intSum2()
	ret1 := intSum2(10)
	ret2 := intSum2(10, 20)
	ret3 := intSum2(10, 20, 30)
	fmt.Println(ret, ret1, ret2, ret3) // 0 10 30 60
}
